package com.ma.Dao;

import com.ma.entity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ProjectName: project
 * @Package: com.ma.Dao
 * @ClassName: MessageDao
 * @Author: YHHHH
 * @Description:
 * @Date: 2021/3/20 14:51
 * @Version: 1.0
 */
@Mapper
public interface MessageDao {
    /*
    通过接受者的ID找到收到的消息
     */
    List<Message> findByID(@Param("receiveID") String receiveID);

    /*
    新增消息
     */
    Integer addMessage(Message message);

    /*
    查看已读消息
     */
    List<Message> findReadedMessage(@Param("receiveID") String receiveID);
    /*
    改变消息状态
     */
    Integer updateState(@Param("id") Integer id);

    /*
    查看老师的未读消息
     */
    List<Message> teacherMessage(@Param("receiveID")String receiveID);
}
